package com.cangchu.db.domain;

import com.cangchu.util.GsonUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 批次类
 * Created by 张博文 on 2016/10/27.
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
public class Batch  extends BaseData {

    //批次号
    private String code;
    //生产日期
    private String date;
    //数量
    private String count;
    //详情
    private String info;
    //商品码
    private String goodsCode;

    public static void main(String[] args) {

        List<Batch> list = new ArrayList<>();
        Batch batch1 = new Batch();
        batch1.setCode("B0001");
        batch1.setDate(new Date().toLocaleString());
        batch1.setCount("10");
        batch1.setInfo("info1");
        batch1.setGoodsCode("238406654286");
        list.add(batch1);

        Batch batch2 = new Batch();
        batch2.setCode("B0002");
        batch2.setDate(new Date().toLocaleString());
        batch2.setCount("20");
        batch2.setInfo("info2");
        batch2.setGoodsCode("238406654286");
        list.add(batch2);

        Batch batch3 = new Batch();
        batch3.setCode("B0003");
        batch3.setDate(new Date().toLocaleString());
        batch3.setCount("30");
        batch3.setInfo("info3");
        batch3.setGoodsCode("963742312");
        list.add(batch3);

        Batch batch4 = new Batch();
        batch4.setCode("B0004");
        batch4.setDate(new Date().toLocaleString());
        batch4.setCount("40");
        batch4.setInfo("info4");
        batch4.setGoodsCode("963742312");
        list.add(batch4);

        System.out.println(GsonUtil.toJson(list));

    }

}
